package com.neusoft.arr;

public class Ex7 {
	/*
	 * ​ 7. 给定一维数组{ -10,2,3,246,-100,0,5} ,计算出数组中的平均值、最大值、最小值。 
	 */
	public static void main(String[] args) {
		int[] arr = {-10,2,3,246,-100,0,5};
		int max = arr[0];
		int min = arr[0];
		int sum = 0;
		for(int i=0;i<arr.length;i++){
			if(max>arr[i]){
				max = arr[i];
			}
			if(min<arr[i]){
				min = arr[i];
			}
			sum += arr[i];
		}
		System.out.println(min);
		System.out.println(max);
		System.out.println(sum/arr.length);
		
	}
}
